<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'sys_attachmentList.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->

</head>
<script type="text/javascript"  src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

<script type="text/javascript">
    function deleteById(id) {

        $.post( 'http://localhost:8080/spring2/sys_attachment/deleteSys_attachment?id=' + id).done(function(data) {

            var rst = data.responseText;

            if (rst == '1') alert('删除成功！');
            else alert('删除失败'+ rst.toString());
        });

    }
</script>
<body>
<c:forEach items="${sList }" var="s">
    <form action="http://localhost:8080/spring2/sys_attachment/updateSys_attachment" method="post">
        ID: <input type="text" value="${s.id}" id="id" name="id" readonly="readonly">
        content_type：<input type="text" value="${s.content_type}" id="content_type" name="content_type">
        create_by: <input type="text" value="${s.create_by}" id="create_by" name="create_by">
        <br/>
        create_time：<input type="text" value="${s.create_time}" id="create_time" name="create_time">
        enable：<input type="text" value="${s.enable}" id="enable" name="enable">
        file_name：<input type="text" value="${s.file_name}" id="file_name" name="file_name">
        <br/>
        file_size：<input type="text" value="${s.file_size}" id="file_size" name="file_size">
        file_url：<input type="text" value="${s.file_url}" id="file_url" name="file_url">
        del_flag：<input type="text" value="${s.del_flag}" id="del_flag" name="del_flag">
        <input type="submit" value="更新" >
    </form>
    <button onclick="deleteById(${s.id})">删除</button>
    <hr/>
</c:forEach>
</body>
</html>
